package com.tomato.displaySample;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

public class Camera_SpecView extends Activity {
	
	ImageView cameraSpec_bottomDataValue1,
			  cameraSpec_bottomDataValue2,
			  cameraSpec_bottomDataValue3,
			  cameraSpec_bottomDataValue4,
		      cameraSpec_bottomDataValue5;
	
	TextView cameraSpec_bottomDataTitle6;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.camera_spec_view);
	    // TODO Auto-generated method stub
	    Intent intent = getIntent();
	    String title = intent.getStringExtra("chtext");
	    int state = intent.getIntExtra("state", 0);
	    
	    cameraSpec_bottomDataValue1 = (ImageView)findViewById(R.id.cameraSpec_bottomDataValue1);
	    cameraSpec_bottomDataValue2 = (ImageView)findViewById(R.id.cameraSpec_bottomDataValue2);
	    cameraSpec_bottomDataValue3 = (ImageView)findViewById(R.id.cameraSpec_bottomDataValue3);
	    cameraSpec_bottomDataValue4 = (ImageView)findViewById(R.id.cameraSpec_bottomDataValue4);
	    cameraSpec_bottomDataValue5=  (ImageView)findViewById(R.id.cameraSpec_bottomDataValue5);
	   
	    cameraSpec_bottomDataTitle6 = (TextView)findViewById(R.id.cameraSpec_bottomDataTitle6);
	    cameraSpec_bottomDataTitle6.setText(title);
	    
	    cameraSpec_bottomDataValue1.setImageResource(R.drawable.picture1);
	    cameraSpec_bottomDataValue2.setImageResource(R.drawable.picture2);
		cameraSpec_bottomDataValue3.setImageResource(R.drawable.picture3);
		cameraSpec_bottomDataValue4.setBackgroundColor(R.color.dio_Off);

	    switch(state)
	    {
	    	case 1:
	    	{
	    		cameraSpec_bottomDataValue1.setVisibility(View.INVISIBLE);
	    		cameraSpec_bottomDataValue5.setImageResource(R.drawable.picture1);
	    		break;
	    	}
	    	case 2:
{
				cameraSpec_bottomDataValue2.setVisibility(View.INVISIBLE);
	    		cameraSpec_bottomDataValue5.setImageResource(R.drawable.picture2);
	 	    	
	    		break;
	    	}
	    	case 3:
	    	{
				cameraSpec_bottomDataValue3.setVisibility(View.INVISIBLE);
	    		cameraSpec_bottomDataValue5.setImageResource(R.drawable.picture3);
	 	    	
	    		break;
	    	}
	    }
	    cameraSpec_bottomDataValue1.setOnClickListener(imageview_Listener); 
	    cameraSpec_bottomDataValue2.setOnClickListener(imageview_Listener); 
	    cameraSpec_bottomDataValue3.setOnClickListener(imageview_Listener); 
		   
	    
	}

	
	private OnClickListener imageview_Listener=new OnClickListener() {
		@Override
		public void onClick(View v) {
			switch(v.getId()){
				case R.id.cameraSpec_bottomDataValue1:
				{	
					cameraSpec_bottomDataValue1.setVisibility(View.INVISIBLE);
					cameraSpec_bottomDataValue2.setVisibility(View.VISIBLE);
					cameraSpec_bottomDataValue3.setVisibility(View.VISIBLE);
					cameraSpec_bottomDataValue5.setImageResource(R.drawable.picture1);
		    		cameraSpec_bottomDataTitle6.setText(R.string.camera_Ch1);
		 	    	
					break;
				}
				case R.id.cameraSpec_bottomDataValue2:
				{
					cameraSpec_bottomDataValue1.setVisibility(View.VISIBLE);
					cameraSpec_bottomDataValue2.setVisibility(View.INVISIBLE);
					cameraSpec_bottomDataValue3.setVisibility(View.VISIBLE);
					cameraSpec_bottomDataValue5.setImageResource(R.drawable.picture2);
		    		cameraSpec_bottomDataTitle6.setText(R.string.camera_Ch2);
		 	    	
		    		break;
				}
				case R.id.cameraSpec_bottomDataValue3:
				{
					cameraSpec_bottomDataValue1.setVisibility(View.VISIBLE);
					cameraSpec_bottomDataValue2.setVisibility(View.VISIBLE);
					cameraSpec_bottomDataValue3.setVisibility(View.INVISIBLE);
					cameraSpec_bottomDataValue5.setImageResource(R.drawable.picture3);
		    		cameraSpec_bottomDataTitle6.setText(R.string.camera_Ch3);
		 	    	
		    		break;
				}
				
			}

		}
	};
}
